package C622;

import java.util.Comparator;
import java.util.concurrent.Callable;

/**
 * @program: javase
 * @description:
 * @author: luolidong
 * @create: 2021-06-22 14:47
 * @version: 1.0
 */
public class InnerTest {
    private int id = 10;
    private String name="jack";
    //实例内部类
    public class Inner {
        private int id = 20;

        public void getId() {
            System.out.println("id = " + id);//内部类中存在id属性
            System.out.println("name = " + name);//内部类中不存在name属性
            System.out.println("this.id = " + this.id);//显式访问内部类id属性
            System.out.println("InnerTest.this.id = " + InnerTest.this.id);//访问外部类id属性
//            play();
        }
    }

    public static class InnerStatic {
        private int id = 20;

        public void getId() {
//            int id=0;
//            this指定到内部类对象找
            System.out.println("this.id = " + this.id);
            System.out.println("id = " + id);

        }
    }

//    方法
    public void play(){
        System.out.println("play");
        class Inner2{

        }
    }

    public static void main(String[] args) {
        InnerTest innerTest = new InnerTest();
        Inner inner = innerTest.new Inner();
        inner.getId();
//        new Inner();
//        new InnerStatic();
//        Runnable;
//        Comparator;
//        Callable
    }
}
